#include<iostream>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<set>
#include<algOrithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;

long long t,d,m;

bool init()
{
	cin>>d>>m;
	long long point=0;
	long long timen=0;
	for(long long i=0;i<m;++i)
	{
		long long a,b;cin>>a>>b;
		long long rest=a-timen-1;rest=max(rest,(long long)0);
		if(1)
		{
			long long back1=point+rest;back1=min(back1,d);back1=d-back1;
			long long back2=point-rest;back2=max(back2,(long long)0);
			point=min(back1,point);
			point=min(back2,point);
		}
		cout<<"check: "<<rest<<ends<<point<<endl;
		if(b-a>d-point)return false;
		point+=b-a;
		timen=b;
//		polong long+=rest;polong long=min(polong long,d);
	}
	return true;
}
int main()
{
	cin.sync_with_stdio(false);
	int t;cin>>t;
	while(t--)
	{
		if(!init()){
		cout<<"impossible\n";
		return 0;
		}
	}	
	cout<<"possible\n";
	return 0;
 } 
